package games.platformer.behaviors;


/**
 * When two of the objects intersect one object goes on top of the other one
 * 
 * @author Jonathan Odom, Ben Shelton
 */
public class IntersectAndMoveToTop extends Intersect
{
    public IntersectAndMoveToTop (vooga.geom.Vector velocity,
    		vooga.entities.Entity obstacle)
    {
        super(velocity, obstacle);
    }

    public IntersectAndMoveToTop (vooga.geom.Vector velocity,
                               java.util.List<vooga.entities.Entity> obstacles)
    {
        super(velocity, obstacles);
    }
    
    public IntersectAndMoveToTop (vooga.geom.Vector velocity,
            java.util.Collection<vooga.entities.Entity> obstacles)
    {
    	super(velocity, obstacles);
	}


    protected void onCollide (vooga.entities.Entity lhs, vooga.entities.Entity rhs)
    {	
    	lhs.setBottom(rhs.getTop());
    	lhs.getVelocity().setYChange(0);
    }
}
